package net.destroyer.game.tetris.core.shape.cube;

import javax.media.j3d.Transform3D;
import javax.media.j3d.TransformGroup;

import net.destroyer.game.tetris.core.util.RefferencePoint;

public class ActiveGameCube extends GameCube {

	public ActiveGameCube() {
			this.addChild(new Cube(Cube.WIRED, 0.5d));
			this.addChild(new Cube(Cube.NORMAL, 0.499d));
			this.refpoint = new RefferencePoint();
			this.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
			this.setCapability(TransformGroup.ALLOW_TRANSFORM_READ);
	}
	public ActiveGameCube(RefferencePoint p) {
		this.addChild(new Cube(Cube.WIRED, 0.5d));
		this.addChild(new Cube(Cube.NORMAL, 0.499d));
		this.refpoint = p;
		this.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
		this.setCapability(TransformGroup.ALLOW_TRANSFORM_READ);
		Transform3D tr = new Transform3D();
		tr.setIdentity();
		tr.setTranslation(refpoint.getVector());
		this.setTransform(tr);
}
	public RefferencePoint getRefPoint() {
		return this.refpoint;
	}
}
